package cn.yunhe.action;

import cn.yunhe.entity.User;
import cn.yunhe.service.UserService;

public class LoginAction extends BaseAction {
	private String username;
	private String password;
	private int userid;
	private int flag;
	
	//登录验证
	public String login() {
		UserService us=new UserService();
		User user=us.login(username, password);
		if (user!=null) {
			getMapSession().put("user",user);
			return SUCCESS;
		}else {
			return ERROR;
		}
	}
	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public int getUserid() {
		return userid;
	}
	public void setUserid(int userid) {
		this.userid = userid;
	}
	public int getFlag() {
		return flag;
	}
	public void setFlag(int flag) {
		this.flag = flag;
	}
	
}
